home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000046_icon-group-sender _Mon Jun 1 09:05:41 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
5KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA02642
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 1 Jun 1998 09:05:35 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA04735; Mon, 1 Jun 1998 09:05:28 -0700
Message-Id: <3.0.5.32.19980530023718.007aa100@doors>
X-Sender: bgbauer#alpha.delta.edu@doors
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32)
Date: Sat, 30 May 1998 02:37:18 -0700
To: "Icon Group"<icon-group@optima.CS.Arizona.EDU>
From: bauerb <bauerb@geocities.com>
Subject: Re: Determining O/S
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 3679
>At 05:56 AM 5/27/98 -0500, GEP wrote:
>>Note that under Windows (of any flavor) the program can be changed from
>>"console" to "windowed" at any time, and vice-versa, and without advance
>>notice.
>> How? Isnt the program limited to console only, if compiled with NTICONT?
>> and Windowed only, if compiled with WICONT?
>As near as I can tell, you are right. I don't know what he means here.
>Clint, jeffery@cs.utsa.edu
Ok, I guess the easiest way for me to explain, is give a few examples.
I've created a procedure DateInFormat(i, s1):s2
i an integer of the seconds past the standard 'base year' of 1970.
(optional, default is current time).
s1 a string template for the Date. Example: "dddd, MMMM dd, yyyy"
or "MM/dd/yy". (optional, default is the users current preference,
as determined using 'localization' settings for windows.
s2 a string of the date in the format of s1. Examples: (using above
templates)
"Tuesday, March 10, 1987" or "3/10/87"
So I can do something similar to
sdate := DateInFormat(secs)
and have the date formatted in the standard the user is used to, or if I
specify
a format, in that format (which could even be something like
DateInFormat(,"Today is dddd") : "Today is Tuesday".
Ok, in this situation, the localization (and timezone bias etc.) settings
for win3.1 are located in win.ini, but the localization settings for win95
and NT are located in
the registry. In win95 they are 'left' in the win.ini, but arent
maintained, so daylight savings time isnt accounted for, and neither are
changes to timezones after the user first installs Win95. (In my
situation, Ive moved from -5 to -8 hoursfromGMT since installing win95,
which means at times the win.ini settings for timezone are up to 4 hours
incorrect.) So this is why It would matter if Im in Win3.1 or Win95/NT.
The procedure would need to gather 'defaults' from separate places
depending on what O/S it's run on (and yet another location from UNIX if
one exists).
I realise I can use system("VER > VER.TMP") but so far I've had trouble
with system() commands which create new files (as was talked about in
previous posts). Im just wondering the 'fastest' and 'least overhead' way
to determine O/S.
Win3.1/Win32's cant count the same as Win95 in this case, so the &features
way Ive noticed people use I don't think will work.
About the "console" or "window":
The main program I am working on now, I originally coded all to work as a
DOS Command line utility. Im ready now, to take the source, and begin
adding windows features, and compile using wincont.
I would like to not have to maintain 2 separate versions of source, and
separately compiled executables, just to offer 2 different versions of the
program. 1 for DOS, one for Windows.
Im wondering if its possible to do something similar to:
If \win then WindowWrite("My output") # run as a windows app
else write("My output") # run as console app
(Forgive me but I cant remember the function to write to a window yet.)
>From testing, ive noticed I will now need to go through all my source, and
alter
any of the commands I used to give status reports, changing them from
'write()'
to the correct "Windows" command, otherwise programs compiled with WICONT
seem to create a new window just for write() output. But if I change them
all, I lose the ability to run the app in DOS mode. So i'll have to
maintain two separate versions.
Is there a way to run a program compiled with wicont, as a console app? and
keeps its
output to the console, and not a window?
Hopefully I havent confused you more, I appologise if I have.
scissors